package com.jumi.microservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumi.microservice.dto.reponse.SalesReponse;
import com.jumi.microservice.dto.reponse.api.SelfShopResponse;
import com.jumi.microservice.entity.CommonGroup;
import com.jumi.microservice.service.IJmUserSalesService;
import com.jumi.microservice.entity.JmUserSales;
import com.jumi.microservice.mapper.JmUserSalesMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户业绩表 服务实现类
 * </p>
 *
 * @author 要挑客户管理团队
 * @since 2020-07-14
 */
@Service
public class JmUserSalesServiceImpl extends ServiceImpl<JmUserSalesMapper, JmUserSales> implements IJmUserSalesService{

    @Autowired
    JmUserSalesMapper mapper;

    @Override
    public Page getPage(Page page, Wrapper wrapper) {
        return mapper.salesPage(page,wrapper);
    }

    @Override
    public BigDecimal getSumSales(QueryWrapper wrapper) {
        return mapper.getSumSales(wrapper);
    }


    @Override
    public Page getSalesByInviterId(Page page,Integer inviterId,QueryWrapper wrapper) {
        return mapper.getSalesByInviterId(page,inviterId,wrapper);
    }

    @Override
    public Integer getSumOrderNum(Wrapper wrapper) {
        return mapper.getSumOrderNum(wrapper);
    }

    @Override
    public BigDecimal getSelfMoney(QueryWrapper wrapper) {
        return mapper.getSelfMoney(wrapper);
    }

    @Override
    public Page<SelfShopResponse> getSelfPage(Page page,QueryWrapper wrapper) {
        return mapper.getSelfPage(page,wrapper);
    }

    @Override
    public List<CommonGroup> getSumSalesByConsumerType(QueryWrapper wrapper) {
        return mapper.getSumSalesByConsumerType(wrapper);
    }
}
